package cn.cxq.learning.array;

public class ArrayUtil {

    public static void main(String[] args) {
        format("\n" +
                "[[1,2,3],[4,5,6],[7,8,9]]\n");
    }

    public static void format(String array) {
        for (int i = 0; i < array.length(); i++) {
            if (array.charAt(i) == '[') array = array.substring(0, i) + "{" + array.substring(i + 1);
            if (array.charAt(i) == ']') array = array.substring(0, i) + "}" + array.substring(i + 1);
        }
        System.out.println(array);
    }
}
